<template>
	<div>
		<!-- 内容 -->
		<transition name="fade" mode="out-in" appear>
			<!--<card-model v-on:ondefaultAccount="defaultAccount" :cardData="data.received.card" :cardConfig="config.show"></card-model>-->
			<el-row>
				<el-col :span="12">
					<el-card class="box-card">
						<div slot="header" class="clearfix">
							<span>会员基本信息</span>
						</div>
						<div>
							<p>
								<span>用户ID：</span>
								<span>{{users.id}}</span>
							</p>
							<p>
								<span>用户名：</span>
								<span>{{users.username}}</span>
							</p>
							<p>
								<span>性别：</span>
								<span>{{users.sex}}</span>
							</p>
							<p>
								<span>联系方式：</span>
								<span>{{users.contact_number}}</span>
							</p>
							<p>
								<span>银行卡号：</span>
								<span>{{users.bank_car}}</span>
							</p>
							<p>
								<span>微信ID：</span>
								<span>{{users.wx}}</span>
							</p>
							<p>
								<span>QQ：</span>
								<span>{{users.qq}}</span>
							</p>
							<p>
								<span>注册时间：</span>
								<span>{{users.regist_time}}</span>
							</p>
							<p>
								<span>会员等级：</span>
								<span>{{users.dj_name}}</span>
							</p>
							<p>
								<span>总积分：</span>
								<span>{{users.total_integral}}</span>
							</p>
							<p>
								<span>当前积分：</span>
								<span>{{users.integral}}</span>
							</p>
							<p>
								<span>总红包金额：</span>
								<span>{{users.total_money}}</span>
							</p>
							<p>
								<span>已提现红包金额：</span>
								<span>{{users.have_withdrawal_money}}</span>
							</p>
							<p>
								<span>当前红包：</span>
								<span>{{users.money}}</span>
							</p>
						</div>
					</el-card>
				</el-col>
				<el-col :span="12">
					<el-card class="box-card" v-for="item in cars">
						<div slot="header" class="clearfix">
							<span>车辆信息</span>
						</div>
						<div>
							<p>
								<span>车主姓名：</span>
								<span>{{item.name}}</span>
							</p>
							<p>
								<span>车型车号：</span>
								<span>{{item.vehicle_type}}</span>
							</p>
							<p>
								<span>车牌号码：</span>
								<span>{{item.number}}</span>
							</p>
							<p>
								<span>身份证号：</span>
								<span>{{item.identity}}</span>
							</p>
							<p>
								<span>爱车品牌：</span>
								<span>{{item.vehicle_brand}}</span>
							</p>
							<p>
								<span>驾驶证（正面）：</span>
								<img :src="item.driving_papers_1" style="width: 200px;"/>
							</p>
							<p>
								<span>驾驶证（反面）：</span>
								<img :src="item.driving_papers_2" style="width: 200px;"/>
							</p>
						</div>
					</el-card>
				</el-col>
			</el-row>
		</transition>
	</div>
</template>

<script>
	import http from 'assets/js/http.js'
	import cardModel from 'components/Common/card-model.vue'
	export default {
		components: {
			cardModel
		},
		data() {
			return {
				id: '',
				users: {},
				cars: [],
			}
		},
		created() {
			this.id = this.$route.params.id
			console.log('详情页id', this.id)
			const data = {
				'uid': this.id
			}
			this.$watch('$route', {
				deep: true,
				handler: function() {
					this.id = this.$route.params.id
					this.apiPost('AdminApi/userList/User_select', data).then(res => {
						this.handelResponse(res, data => {
							console.log('会员详情data1', data)
							this.cars = data.cars

							this.users = data.users
							console.log('this.users', this.users)

						})
					})
				}
			})
			this.apiPost('AdminApi/userList/User_select', data).then(res => {
				this.handelResponse(res, data => {
					console.log('会员详情data', data)
					this.cars = data.cars
					this.users = data.users

				})
			})

		},
		methods: {
			defaultAccount: function() {
				alert('1')
			}

		},
		mixins: [http]
	}
</script>

<style scoped>
	table {
		border-collapse: collapse;
	}
</style>